/* 
 *  UnType
 *
 *  UnType is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Foobar is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY ); without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 **********************************************************************************
 *  WARNING: THIS CODE WAS GENERATED DO NOT MODIFY, CHANGE THE XSD INSTEAD
 *  Generated by schema2code on Tue Jun 14 15:34:00 2016.
 **********************************************************************************
 *  Copyright 2010
 *
 */

#ifndef __UNTYPE_H__
#define __UNTYPE_H__

#include <QObject>
#include <QString>
#include <QDateTime>

class XmlStreamReader;

namespace ivef {

//-----------------------------------------------------------
//! \brief       Class definition of UnType
//!
//! Object type according to CODES FOR\n
//! 						      TYPES OF MEANS OF TRANSPORT Revision 2 (UNECE CEFACT Trade Facilitation\n
//! 						      Recommendation No. 28 edition 2007)
//!
class UnType : public QObject { 
    Q_OBJECT

public:
    //! constructor
    //!
    UnType();
    //! constructor for parser function
    //!
    UnType(XmlStreamReader&);
    //! copy constructor
    //!
    UnType(const UnType&);
    //! = operator
    //!
    UnType & operator=(const UnType& val);
    //! == operator
    //!
    bool operator==(const UnType& val);
    //! sets the CodeA
    //!
    bool setCodeA(QString val);

    //! gets the CodeA
    //!
    //! \return     QString
    //!
    QString getCodeA() const;

    //! sets the CodeB
    //!
    bool setCodeB(QString val);

    //! gets the CodeB
    //!
    //! \return     QString
    //!
    QString getCodeB() const;

    //! returns true if CodeBis used (optional field).
    //!
    //! \return     bool
    bool hasCodeB() const;

    //! sets the Mode
    //!
    bool setMode(int val);

    //! gets the Mode
    //!
    //! \return     int
    //!
    int getMode() const;

    //! generates XML of this object including attributes and child elements
    //! returns QString::null if not all required elements are available
    //! If null returned check lastError() for problem description
    //!
    //! \return     QString
    const QString& toXML(bool outputNamespace = true);

    //! generates output of this object including attributes and child elements
    //!
    //! \return     QString
    QString toString() const;

    //! generates output of this object including attributes and child elements
    //!
    //! \return     QString
    QString toString(QString lead) const;

    //! return last error found in toXML function
    //!
    //! \return     QString
    const QString& lastError() const;

    //! return changed 
    //!
    //! \return     bool
    const bool& changed() const;

    //! return store 
    //!
    //! \return     QString
    const QString& store() const;


private:
    QString m_codeA;
    bool m_codeAPresent;
    QString m_codeB;
    bool m_codeBPresent;
    int m_mode;
    bool m_modePresent;
    QString m_lastError; 
    bool m_changed; 
    QString m_store;
}; 
} //end ns

#endif
